Skip to content

fix(volume/prune): document label!= filter in --filter flag description#6924

Open
mohithshuka wants to merge 2 commits intodocker:masterfrom
mohithshuka:fix/volume-prune-label-filter-consistency
Open

fix(volume/prune): document label!= filter in --filter flag description#6924
mohithshuka wants to merge 2 commits intodocker:masterfrom
mohithshuka:fix/volume-prune-label-filter-consistency

Conversation

@mohithshuka
Copy link
Copy Markdown

Fixes #6918

What changed

The --filter flag for docker volume prune only showed label=<label>
as an example, leaving users unaware that label!=<label> is also valid.

This updates the flag description to mention both forms.

How to verify

Run:

Fixes #24643

--kernel-memory was deprecated in v20.10 and removed in v23.0.
Add deprecation callouts to both the options table and the
Kernel memory constraints section of the run reference page.
The --filter flag for 'docker volume prune' previously only showed
'label=<label>' as an example, not mentioning the negation form
'label!=<label>', even though it is valid and supported by the daemon.

Fixes docker#6918

Signed-off-by: mohithshuka <153504854+mohithshuka@users.noreply.github.com>
@mohithshuka mohithshuka requested review from a team and thaJeztah as code owners April 11, 2026 17:37
Copilot AI review requested due to automatic review settings April 11, 2026 17:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates CLI/documentation text to better reflect supported flag/filter behavior in the Docker CLI docs and help output.

Changes:

  • Extend docker volume prune --filter flag description to include label!=... as a valid example.
  • Mark docker run --kernel-memory as deprecated/removed and add a deprecation notice in the “Kernel memory constraints” section.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
cli/command/volume/prune.go Updates --filter flag help text to mention both label= and label!= forms.
docs/reference/run.md Changes --kernel-memory option description and adds a deprecation callout in the kernel memory section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 58 to 61
flags.SetAnnotation("all", "version", []string{"1.42"})
flags.BoolVarP(&options.force, "force", "f", false, "Do not prompt for confirmation")
flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=<label>")`)
flags.Var(&options.filter, "filter", `Provide filter values (e.g. "label=<label>" or "label!=<label>")`)

Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR updates the --filter help text, but the generated CLI reference docs still show only label=<label> for docker volume prune --filter (see docs/reference/commandline/volume_prune.md marker block). Please regenerate/update the command reference so the documentation published from this repo reflects the new label!=... example as well.

Copilot uses AI. Check for mistakes.
Comment on lines 335 to 338
| `--memory-swap=""` | Total memory limit (memory + swap, format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. |
| `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. |
| `--kernel-memory=""` | Kernel memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. Minimum is 4M. |
| `--kernel-memory=""` | **Deprecated**: Kernel memory limit. Deprecated in Docker v20.10, and removed in Docker v23.0. This option is ignored when set. |
| `-c`, `--cpu-shares=0` | CPU shares (relative weight) |
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation sentence has a grammatical issue: remove the comma after Docker v20.10 ("Deprecated in Docker v20.10 and removed in Docker v23.0").

Copilot uses AI. Check for mistakes.
Comment on lines +505 to +512
> **Deprecated**
>
> The `--kernel-memory` option was deprecated in Docker v20.10 and removed in
> Docker v23.0. The Linux kernel deprecated `kmem.limit_in_bytes` in kernel
> v5.4, and OCI runtimes such as runc no longer support this option. Docker API
> v1.42 and later ignores this option when set. Do not use `--kernel-memory` in
> new configurations. For more details, see the
> [Deprecated features](https://docs.docker.com/engine/deprecated/) page.
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After adding this deprecation callout, the remainder of the “Kernel memory constraints” section still documents how to set and use --kernel-memory (including examples further down). That reads as contradictory to “removed/ignored” and can mislead readers; consider either removing the legacy instructions/examples, or explicitly scoping the rest of the section to older Engine versions where it applied.

Copilot uses AI. Check for mistakes.
Comment on lines 503 to +507
### Kernel memory constraints

> **Deprecated**
>
> The `--kernel-memory` option was deprecated in Docker v20.10 and removed in
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description/title indicate the change is only about docker volume prune --filter documentation, but this PR also changes docker run documentation for --kernel-memory. If this is intentional, please update the PR description (or split into a separate PR) so reviewers and release notes correctly reflect the additional documentation change.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent behavior between label and label! filters in volume prune

2 participants